<?php
define('DS','/');
define('IN_DISCUZ', true);
define('ByShopWWI',true);
define('shopwwi_ROOT', substr(dirname(__FILE__), 0, -3));
$data = require(shopwwi_ROOT.'/data/cache/setting.php');
require_once shopwwi_ROOT.'/data/config/config.ini.php';

//base start
define('BASE_ROOT_PATH',dirname(dirname(__FILE__)));
define('ATTACH_GOODS','shop/store/goods');
define('GOODS_IMAGES_EXT', '_60,_214,_265,_1280');
define('UPLOAD_SITE_URL',$config['upload_site_url']);
define('ATTACH_COMMON','shop/common');
define("BASE_UPLOAD_PATH", BASE_ROOT_PATH . "/data/upload");
//已取消
define('ORDER_STATE_CANCEL', 0);
//已产生但未支付
define('ORDER_STATE_NEW', 10);
//已支付
define('ORDER_STATE_PAY', 20);
//已发货
define('ORDER_STATE_SEND', 30);
//已收货，交易成功
define('ORDER_STATE_SUCCESS', 40);
//订单超过N小时未支付自动取消
function defaultGoodsImage($key){
    $file = str_ireplace('.', '_' . $key . '.', 'default_goods_image.gif');
	return ATTACH_COMMON.DS.$file;
}
function ncPriceFormat($price) {
	$price_format	= number_format($price,2,'.','');
	return $price_format;
}
function orderGoodsType($goods_type)
{
	return str_replace(array("1", "2", "3", "4", "5", "8", "9"), array("", "特卖", "限时折扣", "优惠套装", "赠品", "", "换购"), $goods_type);
}
function orderPaymentName($payment_code) {
    return str_replace(
            array('offline','online','alipay','tenpay','chinabank','predeposit','wxpay'),
            array('货到付款','在线付款','支付宝','财付通','网银在线','站内余额支付','微信支付'),
            $payment_code);
}
function orderState($order_info) {
    switch ($order_info['order_state']) {
        case ORDER_STATE_CANCEL:
            $order_state = '已取消';
        break;
        case ORDER_STATE_NEW:
            $order_state = '待付款';
        break;
        case ORDER_STATE_PAY:
            $order_state = '待发货';
        break;
        case ORDER_STATE_SEND:
            $order_state = '待收货';
        break;
        case ORDER_STATE_SUCCESS:
            $order_state = '交易完成';
        break;
    }
    return $order_state;
}

function cthumb($file, $type = '', $store_id = false) {
    $type_array = explode(',_', ltrim(GOODS_IMAGES_EXT, '_'));
    if (!in_array($type, $type_array) | empty($file)) {
        $type = '240';
    }
    if (empty($file)) {
        return UPLOAD_SITE_URL . '/' . defaultGoodsImage ( $type );
    }
    $search_array = explode(',', GOODS_IMAGES_EXT);
    $file = str_ireplace($search_array,'',$file);
    $fname = basename($file);
    // 取商城ID
    if ($store_id === false || !is_numeric($store_id)) {
        $store_id = substr ( $fname, 0, strpos ( $fname, '_' ) );
    }
    // 本地存储时，增加判断文件是否存在，用默认图代替
    if ( !file_exists(BASE_UPLOAD_PATH . '/' . ATTACH_GOODS . '/' . $store_id . '/' . ($type == '' ? $file : str_ireplace('.', '_' . $type . '.', $file)) )) {
        return UPLOAD_SITE_URL.'/'.defaultGoodsImage($type);
    }
    $thumb_host = UPLOAD_SITE_URL . '/' . ATTACH_GOODS;
    return $thumb_host . '/' . $store_id . '/' . ($type == '' ? $file : str_ireplace('.', '_' . $type . '.', $file));
}
function url($act = '', $op = '', $args = array(), $model = false, $site_url = ''){
    //伪静态文件扩展名
    $ext = '.html';
    //入口文件名
    $file = 'index.php';
//    $site_url = empty($site_url) ? SHOP_SITE_URL : $site_url;
    $act = trim($act);
    $op = trim($op);
    $args = !is_array($args) ? array() : $args;
    //定义变量存放返回url
    $url_string = '';
    if (empty($act) && empty($op) && empty($args)) {
        return $site_url;
    }
    $act = !empty($act) ? $act : 'index';
    $op = !empty($op) ? $op : 'index';

    $model = $model ? URL_MODEL : $model;

    if ($model) {
        //伪静态模式
        $url_perfix = "{$act}-{$op}";
        if (!empty($args)){
            $url_perfix .= '-';
        }
        $url_string = $url_perfix.http_build_query($args,'','-').$ext;
        $url_string = str_replace('=','-',$url_string);
    }else {
        //默认路由模式
        $url_perfix = "act={$act}&op={$op}";
        if (!empty($args)){
            $url_perfix .= '&';
        }
        $url_string = $file.'?'.$url_perfix.http_build_query($args);
    }
    //将商品、商城、分类、品牌、文章自动生成的伪静态URL使用短URL代替
    $reg_match_from = array(
	    '/^login-index\.html$/',
	    '/^promotion-index\.html$/',
		'/^invite-index\.html$/',
	    '/^special-special_list\.html$/',
		'/^special-special_detail-special_id-(\d+)\.html$/',
        '/^category-index\.html$/',
        '/^goods-index-goods_id-(\d+)\.html$/',
        '/^show_store-index-store_id-(\d+)\.html$/',
        '/^show_store-goods_all-store_id-(\d+)-stc_id-(\d+)-key-([0-5])-order-([0-2])-curpage-(\d+)\.html$/',
        '/^article-show-article_id-(\d+)\.html$/',
        '/^article-article-ac_id-(\d+)\.html$/',
        '/^document-index-code-([a-z_]+)\.html$/',
        '/^search-index-cate_id-(\d+)-b_id-([0-9_]+)-a_id-([0-9_]+)-key-([0-3])-order-([0-2])-type-([0-1])-gift-([0-1])-area_id-(\d+)-curpage-(\d+)\.html$/',
		'/^channel-index-id-(\d+)\.html$/',
        '/^brand-list-brand-(\d+)-key-([0-3])-order-([0-2])-type-([0-1])-gift-([0-1])-area_id-(\d+)-curpage-(\d+)\.html$/',
        '/^brand-index\.html$/',

        '/^show_groupbuy-index\.html$/',
        '/^show_groupbuy-groupbuy_detail-group_id-(\d+)\.html$/',

        '/^show_groupbuy-groupbuy_list-class-(\d+)-s_class-(\d+)-groupbuy_price-(\d+)-groupbuy_order_key-(\d+)-groupbuy_order-(\d+)-curpage-(\d+)\.html$/',
        '/^show_groupbuy-groupbuy_soon-class-(\d+)-s_class-(\d+)-groupbuy_price-(\d+)-groupbuy_order_key-(\d+)-groupbuy_order-(\d+)-curpage-(\d+)\.html$/',
        '/^show_groupbuy-groupbuy_history-class-(\d+)-s_class-(\d+)-groupbuy_price-(\d+)-groupbuy_order_key-(\d+)-groupbuy_order-(\d+)-curpage-(\d+)\.html$/',

        '/^show_groupbuy-vr_groupbuy_list-vr_class-(\d+)-vr_s_class-(\d+)-vr_area-(\d+)-vr_mall-(\d+)-groupbuy_price-(\d+)-groupbuy_order_key-(\d+)-groupbuy_order-(\d+)-curpage-(\d+)\.html$/',
        '/^show_groupbuy-vr_groupbuy_soon-vr_class-(\d+)-vr_s_class-(\d+)-vr_area-(\d+)-vr_mall-(\d+)-groupbuy_price-(\d+)-groupbuy_order_key-(\d+)-groupbuy_order-(\d+)-curpage-(\d+)\.html$/',
        '/^show_groupbuy-vr_groupbuy_history-vr_class-(\d+)-vr_s_class-(\d+)-vr_area-(\d+)-vr_mall-(\d+)-groupbuy_price-(\d+)-groupbuy_order_key-(\d+)-groupbuy_order-(\d+)-curpage-(\d+)\.html$/',

        '/^pointshop-index.html$/',
        '/^pointprod-plist.html$/',
        '/^pointprod-pinfo-id-(\d+).html$/',
        '/^pointvoucher-index.html$/',
        '/^pointgrade-index.html$/',
        '/^pointgrade-exppointlog-curpage-(\d+).html$/',
        '/^goods-comments_list-goods_id-(\d+)-type-([0-3])-curpage-(\d+).html$/'
        );
    $reg_match_to = array(
	    'login.html',
	    'promotion.html',
		'invite.html',
	    'topic.html',
		'topic-\\1.html',
        'category.html',
        'item-\\1.html',
        'shop-\\1.html',
        'shop_view-\\1-\\2-\\3-\\4-\\5.html',
        'article-\\1.html',
        'article_cate-\\1.html',
        'document-\\1.html',
        'cate-\\1-\\2-\\3-\\4-\\5-\\6-\\7-\\8-\\9.html',
		'channel-\\1.html',
        'brand-\\1-\\2-\\3-\\4-\\5-\\6-\\7.html',
        'brand.html',

        'tm.html',
        'tm-\\1.html',

        'tm_list-\\1-\\2-\\3-\\4-\\5-\\6.html',
        'tm_soon-\\1-\\2-\\3-\\4-\\5-\\6.html',
        'tm_history-\\1-\\2-\\3-\\4-\\5-\\6.html',

        'vr_tm_list-\\1-\\2-\\3-\\4-\\5-\\6-\\7-\\8.html',
        'vr_tm_soon-\\1-\\2-\\3-\\4-\\5-\\6-\\7-\\8.html',
        'vr_tm_history-\\1-\\2-\\3-\\4-\\5-\\6-\\7-\\8.html',

        'integral.html',
        'integral_list.html',
        'integral_item-\\1.html',
        'voucher.html',
        'grade.html',
        'explog-\\1.html',
        'comments-\\1-\\2-\\3.html'
    );
    $url_string = preg_replace($reg_match_from,$reg_match_to,$url_string);
    return rtrim($site_url,'/').'/'.$url_string;
}

function showpage($total_num,$page){
	global $limit;
	$total_page = ceil($total_num / $limit);
	$html_page = '';
	$left_current_html = '<li><span class="currentpage">';
	$right_current_html = '</span></li>';
	$left_inside_a_html = '<span>';
	$right_inside_a_html = '</span>';
	$pre_page = '<';
	$next_page = '>';
	$page_url = preg_replace('/&(page)\=[^&]*/','', $_SERVER['REQUEST_URI']);
	$page_url = $page_url.'&page=';
	$html_page.= '<ul>';
	if ($page <= 1) {
		$html_page.= '<li>' . $left_inside_a_html . $pre_page . $right_inside_a_html . '</li>';
	} else {
		$html_page.= '<li><a class="demo" href="' . $page_url . ($page - 1) . '">' . $left_inside_a_html . $pre_page . $right_inside_a_html . '</a></li>';
	}
	for($j=1;$j<=$total_page;$j++){
		if($page==$j){
			$html_page.= '<li>' . $left_inside_a_html . $j . $right_inside_a_html . '</li>';
		}else{
			$html_page.= '<li><a class="demo" href="' . $page_url . ($j) . '">' . $left_inside_a_html . $j . $right_inside_a_html . '</a></li>';
		}
	}
	if ($page == $total_page || $total_page == 0) {
		$html_page.= '<li>' . $left_inside_a_html . $next_page . $right_inside_a_html . '</li>';
	} else {
		$html_page.= '<li><a class="demo" href="' . $page_url . ($page + 1) . '">' . $left_inside_a_html . $next_page . $right_inside_a_html . '</a></li>';
	}
	$html_page.= '</ul>';
	return $html_page;
}
//base end

if(!empty($config) && is_array($config)){
	$site_url = $config['shop_site_url'];
	$version = $config['version'];
	$setup_date = $config['setup_date'];
	$gip = $config['gip'];
	$dbtype = $config['dbdriver'];
	$dbcharset = $config['db'][1]['dbcharset'];
	$dbserver = $config['db'][1]['dbhost'];
	$dbserver_port = $config['db'][1]['dbport'];
	$dbname = $config['db'][1]['dbname'];
	$db_pre = $config['tablepre'];
	$dbuser = $config['db'][1]['dbuser'];
	$dbpasswd = $config['db'][1]['dbpwd'];
	$lang_type = $config['lang_type'];
	$cookie_pre = $config['cookie_pre'];
	$tpl_name = $config['tpl_name'];
}
@ini_set('session.cookie_domain', $config['subdomain_suffix']);
define('UC_CONNECT', ($data['ucenter_connect_type']=='0' ? 'mysql' : 'NULL'));				// 连接 UCenter 的方式: mysql/NULL, 默认为空时为 fscoketopen()
//数据库相关 (mysql 连接时, 并且没有设置 UC_DBLINK 时, 需要配置以下变量)
define('UC_DBHOST', $data['ucenter_mysql_server']);			// UCenter 数据库主机
define('UC_DBUSER', $data['ucenter_mysql_username']);		// UCenter 数据库用户名
define('UC_DBPW',	$data['ucenter_mysql_passwd']);			// UCenter 数据库密码
define('UC_DBNAME', $data['ucenter_mysql_name']);			// UCenter 数据库名称
define('UC_DBCHARSET', strtoupper($dbcharset)=='UTF-8' ? 'utf8' : 'gbk');				// UCenter 数据库字符集
define('UC_DBTABLEPRE', '`'.$data['ucenter_mysql_name'].'`.'.$data['ucenter_mysql_pre']);		// UCenter 数据库表前缀

session_save_path(BASE_ROOT_PATH.'/data/session');
session_start();
$dbcharset = strtoupper($dbcharset)=='UTF-8' ? 'utf8' : 'gbk';

require_once 'db_mysql.class.php';
$GLOBALS['db'] = new dbstuff;
$GLOBALS['db']->connect($dbserver, $dbuser, $dbpasswd, $dbname,$db_pre, $dbcharset);
$GLOBALS['tablepre'] = '`'.$dbname.'`.'.$db_pre;
unset($dbserver, $dbuser, $dbpw, $dbpasswd, $dbname);

$mobile = $_GET['mobile'];
if(empty($mobile))return false;
$limit = 10;
$page = empty($_GET['page'])? 1: (int)$_GET['page'];
$orders_count_query = $GLOBALS['db']->fetch_first("SELECT count(*) as num FROM ".$db_pre."orders as orders WHERE orders.buyer_phone='".$mobile."' AND order_state>0");
$orders_count = $orders_count_query['num'];

$orders_list = $GLOBALS['db']->fetch_all("SELECT orders.* FROM ".$db_pre."orders as orders WHERE orders.buyer_phone='".$mobile."' AND order_state>0 order by add_time DESC LIMIT ".($page-1)*$limit.",".$limit);
$order_list = array();
if(!empty($orders_list)){
foreach($orders_list as $order){
	$order_list[$order['order_id']] = $order;
}
}
unset($orders_list);
if(!empty($order_list)){
	//order common
	$order_common_list = $GLOBALS['db']->fetch_all("SELECT * FROM ".$db_pre."order_common WHERE order_id in (".implode(',',array_keys($order_list)).")");
	foreach ($order_common_list as $value) {
		$order_list[$value['order_id']]['extend_order_common'] = $value;
		$order_list[$value['order_id']]['extend_order_common']['reciver_info'] = @unserialize($value['reciver_info']);
		$order_list[$value['order_id']]['extend_order_common']['invoice_info'] = @unserialize($value['invoice_info']);
	}
	//order goods
	$order_goods_list = $GLOBALS['db']->fetch_all("SELECT * FROM ".$db_pre."order_goods WHERE order_id in (".implode(',',array_keys($order_list)).")");

	foreach ($order_goods_list as $value) {
		$order_list[$value['order_id']]['extend_order_goods'][] = $value;
	}
	//refund_return
	$refund_return_list = $GLOBALS['db']->fetch_all("SELECT * FROM ".$db_pre."refund_return WHERE order_id in (".implode(',',array_keys($order_list)).")");
	foreach($refund_return_list as $value){
		$order_id = $value['order_id'];//订单编号
		$goods_id = $value['order_goods_id'];//订单商品表编号
		$refund_goods[$order_id][$goods_id] = $value;
		$order_list[$order_id]['refund_list'] = $refund_goods[$order_id];
	}
}
unset($order_goods_list);
?>
<style>
<!--

/* 内容部分通用表格样式 */
.ncm-default-table { line-height:20px; width: 100%; border-collapse: collapse; clear: both;}
.ncm-default-table thead th { color: #999; background-color: #FFF; text-align:center; height: 20px; padding: 8px 0; border-bottom: solid 1px #E7E7E7; }
.ncm-default-table th {color: #666;font-size: 13px;text-align:left;padding: 20px 0;}
.ncm-default-table thead td, 
.ncm-default-table tfoot th { background-color: #FFF; height: 20px; padding: 5px 0; border-bottom: solid 1px #E7E7E7;}
.ncm-default-table tfoot th { border-top: solid 1px #E6E6E6;}
.ncm-default-table thead td .checkall,
.ncm-default-table tfoot th .checkall { vertical-align: middle; display: inline-block; *display: inline/*IE7*/; margin: 0 4px 0 8px; *zoom: 1;}
.ncm-default-table thead td label, 
.ncm-default-table tfoot th label { color: #777; vertical-align: middle; display: inline-block; *display: inline/*IE7*/; margin-right: 10px; cursor: pointer; *zoom:1;}
.ncm-default-table tbody th { background-color: #FAFAFA; border: solid #E6E6E6; border-width: 1px 0; padding: 4px 0;}
.ncm-default-table tbody th span { display: inline-block; vertical-align: middle; margin-right: 30px;}
.ncm-default-table tbody th span.goods-name { text-overflow: ellipsis; white-space: nowrap; width: 240px; height: 20px; overflow: hidden;}
.ncm-default-table tbody th a.share-goods { float: right; margin-right: 10px; color: #999;}
.ncm-default-table tbody th a:hover.share-goods { color: #333; text-decoration: none;}
.ncm-default-table tbody th a.share-goods i { vertical-align: middle;}
.ncm-default-table tbody th a.order-trash { float: right; margin-right: 10px; color: #999; padding-right: 10px; border-right: solid 1px #DDD; margin-right: 10px;}
.ncm-default-table tbody th a:hover.order-trash { color: #F33; text-decoration: none;}
.ncm-default-table tbody th a.order-trash i { font-size: 14px; vertical-align: middle;}

.ncm-default-table tbody td { color: #999; background-color: #FFF; text-align: center; padding: 10px 0;}
.ncm-default-table tbody tr.bd-line td { border-bottom: solid 1px #E7E7E7;}
.ncm-default-table tbody td strong { color: #666;}
.ncm-default-table td .pic-thumb { line-height: 0; background-color: #FFF; text-align: center; vertical-align: middle; display: table-cell; *display: block; width: 32px; height: 32px; padding: 2px; border: solid 1px #F5F5F5; overflow: hidden;}
.ncm-default-table td .pic-thumb img { max-width: 32px; max-height: 32px; margin-top:expression(32-this.height/2); *margin-top:expression(16-this.height/2)/*IE6,7*/;}
.ncm-default-table td .goods-name { border: none; overflow: hidden;}
.ncm-default-table td .goods-name dt { font-size: 12px; line-height: 16px; color: #333; display: block; text-align: left; width: 100%; min-height: 16px; max-height: 32px; padding-bottom: 4px; overflow: hidden;}
.ncm-default-table td .goods-name dt a { color: #333;}
.ncm-default-table td .goods-name dt .rec { margin-left: 5px;}
.ncm-default-table td .goods-name dt .rec a { color: #0279b9; }
.ncm-default-table td .goods-name dd { line-height: 20px; display: block; max-width: 280px; height: 20px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;}
.ncm-default-table td .goods-cti { font-size: 0; *word-spacing:-1px/*IE6、7*/;}
.ncm-default-table td .goods-cti span { vertical-align: top; letter-spacing: normal; word-spacing: normal; display: inline-block; *display: inline/*IE7*/; width: 16px; height: 16px; margin-right: 4px; *zoom: 1; }
.ncm-default-table td .goods-cti span img { max-width: 16px; max-height: 16px;}
.ncm-default-table td .goods-price { font-weight: 600; color: #666; background:url(../images/rmb_s.gif) no-repeat 0 3px; padding-left: 10px;}
.ncm-default-table td .goods-type { color: #FFF; background-color: #ff875a; display: inline-block; padding: 2px 5px;}
/* 翻页 */
.pagination{ clear: both; margin: auto;}
.pagination ul{ padding: 50px 0 30px 0; margin: 0; text-align: center;}
.pagination ul li { display: inline-block; list-style-type: none;}
.pagination ul li { *display: inline;}
.pagination  a{font-weight:normal;}
.pagination li span { font-size: 12px; line-height: 28px; color: #777; background-color: #FFF; list-style-type: none; display: inline; height: 28px; float: left; padding: 0px 10px; margin: 0px 1px; border:solid 1px #999899; font-weight:normal;}
.pagination li a span , .pagination li a:visited span { color: #60B3DD; text-decoration: none; cursor:pointer;}
.pagination li a:hover span, .pagination li a:active span{ color: #fff; background-color: #efb217; border-color: #efb217; cursor:pointer;}
.pagination li span.currentpage { color: #fff; font-weight: 600;  background-color: #efb217; border-color: #efb217;}

-->
</style>
<table class="ncm-default-table order">
    <thead>
      <tr>
        <th class="w10"></th>
        <th colspan="2">商品</th>
        <th class="w90">单价（元）</th>
        <th class="w40">数量</th>
        <th class="w90">优惠活动</th>
        <th class="w90">售后维权</th>
        <th class="w110">订单金额</th>
        <th class="w90">交易状态</th>
        <th class="w120">交易操作</th>
      </tr>
    </thead>

<?php 
  if(!empty($order_list)){
  foreach($order_list as $order_info){
	if (isset($order_info['payment_code'])) {
		$order_info['payment_name'] = orderPaymentName($order_info['payment_code']);
	}
	?>
 <tr>
        <th colspan="19"> <span class="ml10"> <!-- order_sn --> 订单编号:<?php echo $order_info['order_sn']; ?></span> 
          <!-- order_time --> 
          <span style="margin-left:100px;">订单时间:  <?php echo date("Y-m-d H:i:s",$order_info['add_time']);?> </span> 
           </th>
      </tr>
       <!-- S 商品列表 -->
      <?php $i = 0;?>
      <?php if (!empty($order_info['extend_order_goods'])) { ?>
      <?php foreach ($order_info['extend_order_goods'] as $k => $goods_info) {
      
      	if (empty($order_info['zengpin_list'])) {
      		$order_info['goods_count'] = count($order_info['extend_order_goods']);
      	} else {
      		$order_info['goods_count'] = count($order_info['extend_order_goods']) + 1;
      	}
        if (isset($order_info['order_state'])) {
            $order_info['state_desc'] = orderState($order_info);
        }
      	?>
      <?php $i++;?>
      <tr>
        <td class="bdl"></td>
        <td class="w70"><div class="ncm-goods-thumb"><img src="<?php echo cthumb($goods_info['goods_image'], 60, $goods_info['store_id'])?>" /></div></td>
        <td class="tl"><dl class="goods-name">
            <dt><?php echo $goods_info['goods_name']; ?><span class="rec"></span></dt>
            <?php if (!empty($goods_info['goods_spec'])) { ?>
          <dd><?php echo $goods_info['goods_spec'];?></dd>
          <?php } ?>
     
          </dl></td>
        <td><?php echo ncPriceFormat($goods_info['goods_price']);?></td>
        <td><?php echo $goods_info['goods_num']; ?></td>
        <td><?php if (!empty($goods_info['goods_type_cn'])) { ?>
          <span class="goods-type"><?php echo $goods_info['goods_type_cn'];?></span>
          <?php } ?></td>
        <td><!-- 退款 -->
         
          <?php if (!empty($order_info['refund_list'])){?>
          <p>有退款/退货</p>
          <?php }?>
                   
          <!-- 投诉 -->
         
        <!-- S 合并TD -->
        <?php if (($order_info['goods_count'] > 1 && $k ==0) || ($order_info['goods_count'] == 1)){?>
        <td class="bdl" rowspan="<?php echo $order_info['goods_count'];?>"><p class=""><strong><?php echo $order_info['order_amount']; ?></strong></p>
          <p class="goods-freight">
            <?php if ($order_info['shipping_fee'] > 0){?>
            (<?php echo $lang['member_order_shipping_han'];?>运费<?php echo $order_info['shipping_fee'];?>)
            <?php }else{?>
            <?php echo '免运费';?>
            <?php }?>
          </p>
          <p title="<?php echo '支付方式';?><?php echo $order_info['payment_name']; ?>"><?php echo $order_info['payment_name']; ?></p></td>
        <td class="bdl" rowspan="<?php echo $order_info['goods_count'];?>"><p><?php echo $order_info['state_desc']; ?> </p>
          
          <!-- 订单查看 -->
          
          <p><a href="http://www.jinguiyinqi.com/api/crm_order_detail_1.php?order_id=<?php echo $order_info['order_id']; ?>">订单详情</a></p>
          
          <!-- 物流跟踪 -->
          </td>
        <td class="bdl bdr" rowspan="<?php echo $order_info['goods_count'];?>"><!-- 永久删除 --> 
          
          <!-- 锁定-->
          
          <?php if ($order_info['lock_state']) { ?>
          <p>退款退货中</p>
          <?php } ?>
          
          </td>
        <!-- E 合并TD -->
        <?php } ?>
        
      </tr>
<?php }}}}else{?>
    <tbody>
      <tr>
        <td colspan="20" class="norecord"><div class="warning-option"><i>&nbsp;</i><span>没有订单</span></div></td>
      </tr>
    </tbody>
<?php }?>
</table>
<div class="pagination">
<?php echo showpage($orders_count,$page);?>
</div>